<!DOCTYPE HTML>
<html>
<head>
    <title>【${app.name}】</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <link rel="stylesheet" href="${contextPath}/css/default.css" type="text/css"/>
    <link rel="stylesheet" href="${contextPath}/css/theme-chalk.css" type="text/css"/>
    <script src="${contextPath}/jquery/jquery.min.js"></script>
    <script src="${contextPath}/vue/vue.global.js"></script>
    <script src="${contextPath}/vue/index.full.js"></script>
    <script src="${contextPath}/vue/utils.js"></script>
</head>
<body>
<div id="app">
    <p class="heading">&nbsp;&nbsp;并发测试</p>
    <div id="content">
        <table class="dataTable2" style="margin-left:0px;margin-top: 5px;">
            <tbody>
            <tr>
                <td style="width:150px;">测试环境</td>
                <td style="text-align:left;width: 600px;">
                    <select id="basePath" style="height:25px;">
                        <#list environments as env>
                            <option env="${env.name!}" value="${env.basePath}">
                                ${env.basePath}(${env.name!}环境-${env.owner!})
                            </option>
                        </#list>
                    </select>
                </td>
                <td width="400" style="font-size: 20px;">
                    测试聚合报告
                </td>
            </tr>
            <tr>
                <td>认证</td>
                <td style="text-align:left;">
                    <input id="orgNo" style="width:60px;height:20px;" placeholder="请输入组织编码" value="${orgNo!}">
                    <input id="account" style="width:100px;height:20px;" placeholder="请输入账号" value="${account!}">
                    <input id="password" type="password" style="width:100px;height:20px;" placeholder="请输入密码"
                           value="${password!}">
                    <input type="button" style="width:100px;height:25px;" value="获取认证信息" onclick="auth()"/>
                </td>
                <td rowspan="10">
                    <div style="overflow:auto;height:800px;width:99%;border:1px dotted #ADB2C6;background-color: #FFF;">
                        <table width="100%" class="dataTable2">
                            <tbody id="pressureTests">

                            </tbody>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td>AccessToken</td>
                <td style="text-align:left;width:150px;"><input id="accessToken" value="${accessToken!}"
                                                                style="width:99%;height:20px;"
                                                                placeholder="请输入accessToken"></td>

            </tr>
            <tr>
                <td>Jwt</td>
                <td style="text-align:left;width:150px;"><input id="jwt" value="${jwt!}"
                                                                style="width:99%;height:20px;"
                                                                placeholder="请输入jwt"></td>
            </tr>
            <tr>
                <td>并发数</td>
                <td style="text-align:left;">
                    <select id="concurrency" style="height:25px;">
                        <option value="1">1</option>
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="20">20</option>
                        <option value="30">30</option>
                        <option value="40">40</option>
                        <option value="50">50</option>
                        <option value="60">60</option>
                        <option value="70">70</option>
                        <option value="80">80</option>
                        <option value="90">90</option>
                        <option value="100">100</option>
                        <option value="200">200</option>
                        <option value="300">300</option>
                        <option value="400">400</option>
                        <option value="500">500</option>
                        <option value="1000">1000</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>次数</td>
                <td style="text-align:left;">
                    <select id="number" style="height:25px;">
                        <option value="1">1</option>
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="20">20</option>
                        <option value="30">30</option>
                        <option value="40">40</option>
                        <option value="50">50</option>
                        <option value="60">60</option>
                        <option value="70">70</option>
                        <option value="80">80</option>
                        <option value="90">90</option>
                        <option value="100">100</option>
                    </select>
                    每个接口的请求次数=并发数*次数
                </td>
            </tr>
            <tr>
                <td>请求模式</td>
                <td style="text-align:left;">
                    <select id="mode" style="height:25px;">
                        <option value="1">按接口顺序</option>
                        <option value="2">所有接口乱序</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>接口</td>
                <td valign="top">
                    <div style="height: 600px;overflow-y: auto;">
                        <el-tree ref="tree"
                                 :data="menuData"
                                 show-checkbox
                                 node-key="apiId"
                                 :default-expanded-keys="defaultExpandedKeys" :default-checked-keys="defaultCheckedKeys"
                                 :props="menuDefaultProps">
                        </el-tree>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input id="btn_test" type="button" style="width:300px;height:40px;font-size:20px" :value="btn_test"
                           @click="exec()"/>
                    <span id="progress" style="font-size: 20px;padding-left: 20px;"></span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <br>

    <br></div>
</body>

<script type="text/javascript">
    var menuData = JSON.parse('[${menuTree}]');
    menuData[0].url = '1';
    var testId = "";
    var appName = "${app.name}";
    var contextPath = "${contextPath}";

    $(document).ready(function () {
        getPressureTests();
    });
</script>

</html>
<script src="${contextPath}/js/util.js"></script>
<script src="${contextPath}/js/test/pressureTest.js?ver=12218"></script>
